package behavioralPattern.state.example01;

public class Client {
    public static void main(String[] args) {

        // 创建模式A
        ConcreteState_A state_a = new ConcreteState_A();
        // 创建上下文
        Context context = new Context();
        // 给上下文设置状态
        state_a.handle(context);
        // 查看上下文维护的状态是谁
        System.out.println(context.getCurrentState().toString());
        System.out.println(context.toString());

        System.out.println("=================================");

        ConcreteState_B state_b = new ConcreteState_B();
        state_b.handle(context);
        System.out.println(context.getCurrentState().toString());

    }
}
